package com.xiaomazi.statistics.controller;

import com.xiaomazi.common.utils.R;
import com.xiaomazi.statistics.service.StatisticsDailyService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @program: llxy-parent
 * @description: 统计分析前端控制器
 * @author: 小马子
 * @create: 2023-03-06 22:40
 **/
@RestController
@RequestMapping("/statistics/sta")
public class StatisticsController {

    @Autowired
    private StatisticsDailyService statisticsDailyService;


    @PostMapping("registerCount/{day}")
    public R registerCount(@PathVariable String day){
        return statisticsDailyService.registerCount(day);
    }


    @GetMapping("showData/{type}/{begin}/{end}")
    public R showData(@PathVariable String type,@PathVariable String begin,
                      @PathVariable String end) {
        return statisticsDailyService.showData(type,begin,end);
    }

}
